-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.js
51 lines (37 loc) · 835 Bytes
/
code.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function setup() {
// Create the canvas
createCanvas(720, 400);
// Create screen reader accessible description
textOutput();
}
function draw() {
// Clear the background
background(0);
// Draw blue square
// Save current coordinate system
push();
// Scale by 2
scale(2);
// Set color to blue
fill(33, 89, 194);
// Draw square at origin, size 200
square(0, 0, 200);
// Restore coordinate system
pop();
// Draw white square
// Set color to white
fill(255);
// Draw square at origin, size 200
square(0, 0, 200);
// Draw green square
// Save current coordinate system
push();
// Scale by .5 in x and .75 in y
scale(0.5, 0.75);
// Set color to green
fill(42, 150, 60);
// Draw square at origin, size 200
square(0, 0, 200);
// Restore coordinate system
pop();
}